package edu.avans.hartigehap.domain;

import edu.avans.hartigehap.domain.IngredientIterator;
import edu.avans.hartigehap.domain.CustomIterator;
import edu.avans.hartigehap.domain.Ingredient;

public class Aggregate {
	//define the size of the array (note: Index starts at 0, so its 6+1)
	static final int MAX_ITEMS = 6;
	
	int numberOfItems = 0;
	Ingredient[] ingredients;
	
	public Aggregate()
	{
		//the constructor creates the array, and adds items to it
		System.out.println("Creating and filling the Menu...");
		
		ingredients = new Ingredient[MAX_ITEMS];
		addItem("IngredientName1");
		addItem("IngredientName2");
		addItem("IngredientName3");
		addItem("IngredientName4");
		addItem("IngredientName5");
		addItem("IngredientName6");
	}
	
	//add one ingredient to the array
	public void addItem(String name)
	{
		// TODO: Wat geven we allemaal mee aan ingredient? Is iets om in overleg te doen met Chris ;-)
		
		Ingredient ingredient = new Ingredient();
		
		if(numberOfItems >= MAX_ITEMS)
		{
			System.err.println("**Ingredient Full**");
		}
		else
		{
			ingredients[numberOfItems] = ingredient;
			numberOfItems ++;
		}
	}

	
	//create an iterator, and pass the array with ingredients
	/*public Iterator createIterator()
	{
		return new IngredientIterator(ingredients);
	}*/
}
